<template>
  <div>
    <basic-container>
      <avue-form v-loading="loading" ref="form" :option="option" v-model="form" :defaults.sync="defaults">
        <template slot="supplierName">
          <el-input
            class="pointer"
            v-model="form.supplierName"
            @focus="openSupplier"
            placeholder="请选择供应商名称"
            readonly
          >
            <i slot="suffix" class="el-icon-search"></i>
          </el-input>
        </template>
      </avue-form>
    </basic-container>
    <!-- 评分信息 -->
    <basic-container>
      <curd-title :title="'评分信息'" />
      <score-info />
    </basic-container>
  </div>
</template>

<script>
import { option, supplierOption } from '@/option/tenant/supplier/performance-form'
import CurdTitle from '@/components/base/title'
import ScoreInfo from '@/views/tenant/supplier/access/components/score-info'
import { setStore } from '@/util/store'

export default {
  inject: ['type'],
  name: 'PerformanceOperation',
  components: { CurdTitle, ScoreInfo },
  data() {
    return {
      form: {},
      defaults: {},
      loading: false,
      option: option.call(this)
    }
  },
  methods: {
    openSupplier() {
      this.$quickModal({
        title: '选择供应商',
        width: '900px',
        componentIsTag: true,
        component: 'suppliers',
        props: {
          multiple: false,
          columns: supplierOption
        },
        on: {
          change: row => {
            console.log(row)
            // this.form.supplierName = row.supplierName
            // this.getDetailAll(row.id)
            // setStore({
            //   name: 'supplierId',
            //   content: row.id,
            //   type: 'session'
            // })
          }
        }
      })
    }
  }
}
</script>

<style></style>
